<script type="text/javascript">

    var cur_days = new Array(); 
    var adults_price ='<?=$excursion->adultPrice;?>'; 
    var children_price ='<?=$excursion->childPrice;?>'; 

    <?  

        $disabled_days = array();
        $days = explode(',',$excursion->startWeekDay);


        if(is_numeric(array_search('Sunday', $days))){
            array_push($disabled_days, 0);
        }
        if(is_numeric(array_search('Monday', $days))){
            array_push($disabled_days, 1);
        }
        if(is_numeric(array_search('Tuesday', $days))){
            array_push($disabled_days, 2);
        }
        if(is_numeric(array_search('Wednesday', $days))){
            array_push($disabled_days, 3);
        }
        if(is_numeric(array_search('Thursday', $days))){
            array_push($disabled_days, 4);
        }
        if(is_numeric(array_search('Friday', $days))){
            array_push($disabled_days, 5);
        }
        if(is_numeric(array_search('Saturday', $days))){
            array_push($disabled_days, 6);
        }


        //$this->firephp->log($days);
        //$this->firephp->log($disabled_days); 

        foreach($disabled_days as $key => $value){?>

        cur_days['<?=$key?>'] = '<?=$value?>';

        <?} 

    ?>  


</script>

<?if($this->lang->lang()=='ru'):?>
<style>
    .dropdownized{
        font-size: 10px !important
    }
</style>
<?endif;?>

<div id="excursions-placeholder">
    <div id="wrap" class="clearfix">

        <div id="aside">
            <div id="changeDetasilsBox">
                <?$this->load->view('excursions/parts/your_details')?>
            </div>
            <div id="serchModule">
                <?$this->load->view('excursions/parts/search_box')?>
            </div>
			<? $this->load->view('destinations/parts/banner') ?>

        </div><!-- / Aside -->

        <div id="main" itemscope itemtype="http://schema.org/Product">

            <div class="title" itemprop="name">

                <? $pices=explode(" ", $excursion->title); ?>

					<h1><span><?= $pices[0] ?></span><?
					for($j=1; $j <= count($pices) - 1; $j++)
					{
						echo ' '.$pices[$j];
					}
					?></h1>

            </div>

            <div class="details-page clearfix">   
                <?
                    $filename = get_thumbnail(273,206,$images[0]->filename);
                ?>
                <img itemprop="image" src="<?=$hosting?>pro-gallery/<?=$excursion->g_path.'/'.$filename?>" alt="" class="details-thumb">   
                <div class="details-info">
                    <p><?=clean_html_p($excursion->description)?></p>
                    <dl>
                        <dt><?= lang('start_day') ?>:</dt>
                        <dd><?=tranlate_days(lang('short_week_days'), $excursion->startWeekDay);?></dd>

                        <dt><?= lang('duration') ?>:</dt>
                        <dd>1 <?= lang('day') ?></dd>

                        <dt><?= lang('guides') ?>:</dt>
                        <dd><?
                                $guides = clean_html_p($excursion->guides);
                                if($guides=="")
                                    echo "&nbsp;";
                                else 
                                    echo $guides;

                        ?></dd>
                    </dl>

                    <span class='big'><?=$excursion->adultPrice?>€ <span>/ <?= lang('person') ?></span></span>
					<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
						<meta itemprop="price" content="<?=$excursion->adultPrice?>€ / <?= lang('person') ?> (<?=$excursion->childPrice?>€ / <?= lang('child') ?>)" />
						<meta itemprop="priceCurrency" content="EUR" />
					</div>
                </div>

                <div class="details-book-now excursions-book-now">

                    <form action="<?=base_url('excursions/check_available')?>" method="POST" id="excusrsionsBook">

                        <input type="hidden" value="<?=$excursion->id?>" id="exc_id" name="exc_id">
                        <input type="hidden" name="totalprice" value="" />
                        <input type="hidden" name="adultprice" value="<?=$excursion->adultPrice?>" />
                        <input type="hidden" name="chprice" value="<?=$excursion->childPrice?>" />

                        <div class="three-col">
                            <div class="right book-price">
                                <div>
                                    <span id="total-price"><span><?= lang('total') ?>: </span> </span>

                                </div>

                                <a href="javascript:" class="button confirm_availability"><?= lang('shared.book.now') ?> &raquo;</a>

                            </div>
                            <ul class="two-columns clearfix me_two_columns_fix">
                                <li class="left excursion-booking-left">
									<h3 class='descriptive-non-visible'><?= lang('online_booking'); ?></h3>
                                    <ul class="side-form">

                                        <li class="clearfix">
                                            <label><?=lang('select_a_date');?>:</label>
                                            <input type="text" id="exc_date" name="exc_date" />
                                        </li>

                                        <li class="clearfix">
                                            <label><?=lang('pickup_info')?>:</label>
                                            <select name="location" id="location" class="dropdownized">
                                                <option value="0"><?=lang('please_select')?></option>
                                                <?
                                                    $locations = explode('__!__',$excursion->pickup_location);
                                                    foreach ($locations as $value):?>
                                                    <option value="<?=$value?>"><?=$value?></option>
                                                    <?endforeach;?>
                                            </select>
                                        </li>

                                    </ul>
                                </li>

                                <li class="right">

                                    <ul class="side-form">

                                        <li class="clearfix">
                                            <label><?=lang('adults')?>:</label>
                                            <? if (!isset($_POST['nr_adults'])) $first_select = 'selected="selected"';?>
                                            <select name="adults" id="adults" class="dropdownized">
                                                <option value="1" <?if (isset($_POST['adults']) && $_POST['adults'] == 1) echo 'selected="selected"'; ?>>1</option>
                                                <option value="2" <?if (isset($_POST['adults']) && $_POST['adults'] == 2) echo 'selected="selected"'; if (isset($first_select)) echo $first_select; ?>>2</option>
                                                <option value="3" <?if (isset($_POST['adults']) && $_POST['adults'] == 3) echo 'selected="selected"'; ?>>3</option>
                                                <option value="4" <?if (isset($_POST['adults']) && $_POST['adults'] == 4) echo 'selected="selected"'; ?>>4</option>
                                                <option value="5" <?if (isset($_POST['adults']) && $_POST['adults'] == 5) echo 'selected="selected"'; ?>>5</option>
                                                <option value="6" <?if (isset($_POST['adults']) && $_POST['adults'] == 6) echo 'selected="selected"'; ?>>6</option>
                                                <option value="7" <?if (isset($_POST['adults']) && $_POST['adults'] == 7) echo 'selected="selected"'; ?>>7</option>
                                                <option value="8" <?if (isset($_POST['adults']) && $_POST['adults'] == 8) echo 'selected="selected"'; ?>>8</option>
                                                <option value="9" <?if (isset($_POST['adults']) && $_POST['adults'] == 9) echo 'selected="selected"'; ?>>9</option>
                                            </select>
                                        </li>

                                        <li class="clearfix">
                                            <label><?=lang('children')?>:<span title="<?= lang('children_discount') ?>" class="cancelation tooltip"></span></label>
                                            <select name="children" id="children" class="dropdownized">
                                                <option value="0" <?if (isset($_POST['children']) && $_POST['children'] == 0) echo 'selected="selected"'; ?>>0</option>
                                                <option value="1" <?if (isset($_POST['children']) && $_POST['children'] == 1) echo 'selected="selected"'; ?>>1</option>
                                                <option value="2" <?if (isset($_POST['children']) && $_POST['children'] == 2) echo 'selected="selected"'; ?>>2</option>
                                                <option value="3" <?if (isset($_POST['children']) && $_POST['children'] == 3) echo 'selected="selected"'; ?>>3</option>
                                                <option value="4" <?if (isset($_POST['children']) && $_POST['children'] == 4) echo 'selected="selected"'; ?>>4</option>
                                                <option value="5" <?if (isset($_POST['children']) && $_POST['children'] == 5) echo 'selected="selected"'; ?>>5</option>
                                                <option value="6" <?if (isset($_POST['children']) && $_POST['children'] == 6) echo 'selected="selected"'; ?>>6</option>
                                                <option value="7" <?if (isset($_POST['children']) && $_POST['children'] == 7) echo 'selected="selected"'; ?>>7</option>
                                                <option value="8" <?if (isset($_POST['children']) && $_POST['children'] == 8) echo 'selected="selected"'; ?>>8</option>
                                                <option value="9" <?if (isset($_POST['children']) && $_POST['children'] == 9) echo 'selected="selected"'; ?>>9</option>
                                            </select>
                                        </li>

                                    </ul>
                                </li>
                            </ul>

                        </div>

                    </form>
                </div>

                <h2><?= lang('details') ?></h2>
                <div class="accomodation-info clearfix" itemprop="description">
                    <?=$excursion->excursion_text?>
                </div>


               <h2><?=lang('itinerary')?></h2>
               <p><?=$excursion->addition?></p>

                <h2><?= lang('details.gallery') ?></h2>
                <ul class="thumb-list">

                    <? 
                        if (isset($images)):
                            array_splice($images, 0, 1);
                            foreach($images as $image): 
                                $filename = get_thumbnail(176,127,$image->filename);
                                $prevfilename = get_thumbnail(800,600,$image->filename);
                            ?>
                            <li>
                                <a class="lightbox" title="<?=$excursion->title?>" href="<?=$hosting?>pro-gallery/<?=$excursion->g_path.'/'.$prevfilename?>">
                                    <img src="<?=$hosting?>pro-gallery/<?=$excursion->g_path.'/'.$filename?>" alt="">
                                </a>
                            </li>
                            <? endforeach; 
                            endif;?>
                </ul>


            </div><!-- / Three Columns -->

        </div><!-- / Mian -->

    </div><!-- / Wrap -->
</div>